Cut command

Hi All,

I am a beginner learning shell script, Would it be possible to use -c and -f in cut command together ?

Example :

/opt/oracle/work/Antony/Shell_Script> cat shortlist
2233|a.k. shukula               |g.m.           |sales2         |12/12/52       |6000
1006|chanchal singhvi           |director       |sales3         |03/09/38       |6700
1265|s.n. dasguptha             |manager        |sales4                 |12/09/63       |5600
2476|anil aggarwal              |manager        |sales1         |01/05/59       |5000
9876|jai sharma                 |director       |production     |12/03/50       |7000
7865|cheran                     |director       |sales1         |01/05/59       |5000
5643|charan                     |engineer       |sales1         |01/05/59       |5000
cat shortlist | cut -c 1,4 -f4

This command is not working and I would like to know is there any possibilities where I can you specific to -c and -f ?

What exactly would you expect that command to do? The options seem contradictory.

cut does not need cat's help to read a file, incidentally.

man cut :

What output do you want? like so:

awk '{print substr($1,1,4), $4}' file
2233 |sales2
1006 |sales3
1265 |sales4
2476 |sales1
9876 |production
7865 |01/05/59
5643 |01/05/59

(as you didn't specify a field separator )

My best guess is that maybe you *want* a field separator to cut?? Then just use fields??