cancel
Showing results for 
Search instead for 
Did you mean: 

Command Line Script

Former Member
0 Kudos

Hi,

I have a new requirement for a file sender communication channel .

My sender will pick up a text file .

But I need to delete the last line of the file before processing . Thats why I need to write a shell script before processing .

Thanks in advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

abhradeepbasu
Participant
0 Kudos

Hi Apu,

Use this:

sed '$d' <file name>

/AB

Former Member
0 Kudos

Hi Abhradeep,

sed '$d' <file name> --- cant be written as file name is not fixed in my case .

iaki_vila
Active Contributor
0 Kudos

Hi Apu,

Depending of your PI OS system:

Linux:

sed -n '$!p' file

Windows:

sed '$d'

Regards.

kenny_scott
Contributor
0 Kudos

Hi Apu,

you haven't described the problem you encountered with your command line script.

Best Regards

Kenny